/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Employee.java
 *
 * Created on Oct 29, 2011, 3:44:20 PM
 */
package VIMS;

/**
 *
 * @author shyan
 */
public class Employee extends javax.swing.JFrame {

    /** Creates new form Employee */
    public Employee() {
        super("Add New Employee");
        initComponents();
        setLocationRelativeTo(null);
    }
    
    public Employee(String state) {
        super("Add New Employee");
        initComponents();
        setLocationRelativeTo(null);
        AddEmpButton.setText(state);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLayeredPane1 = new javax.swing.JLayeredPane();
        PhotoLabel = new javax.swing.JLabel();
        IdField = new javax.swing.JLabel();
        UidLabel = new javax.swing.JLabel();
        PosLabel = new javax.swing.JLabel();
        UserName = new javax.swing.JTextField();
        UnLabel = new javax.swing.JLabel();
        FnLabel = new javax.swing.JLabel();
        FirstName = new javax.swing.JTextField();
        LnLabel = new javax.swing.JLabel();
        LastName = new javax.swing.JTextField();
        IcLabel = new javax.swing.JLabel();
        IcNum = new javax.swing.JTextField();
        Gender = new javax.swing.JComboBox();
        GenderLabel = new javax.swing.JLabel();
        RaceLabel = new javax.swing.JLabel();
        Race = new javax.swing.JComboBox();
        Religion = new javax.swing.JComboBox();
        ReligionLabel = new javax.swing.JLabel();
        Email = new javax.swing.JTextField();
        EmailLabel = new javax.swing.JLabel();
        ConLabel = new javax.swing.JLabel();
        Contact = new javax.swing.JTextField();
        City = new javax.swing.JTextField();
        CityLabel = new javax.swing.JLabel();
        PcLabel = new javax.swing.JLabel();
        PostCode = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        Address = new javax.swing.JEditorPane();
        AddLabel = new javax.swing.JLabel();
        AddEmpButton = new javax.swing.JButton();
        CloseEmpButton = new javax.swing.JButton();
        Gender1 = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(800, 600));

        jLayeredPane1.setMaximumSize(new java.awt.Dimension(800, 600));
        jLayeredPane1.setMinimumSize(new java.awt.Dimension(800, 600));

        PhotoLabel.setFont(new java.awt.Font("Times New Roman", 3, 24));
        PhotoLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        PhotoLabel.setText("Photo");
        PhotoLabel.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));
        PhotoLabel.setBounds(310, 10, 180, 150);
        jLayeredPane1.add(PhotoLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        IdField.setText("100002");
        IdField.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        IdField.setBounds(170, 200, 150, 30);
        jLayeredPane1.add(IdField, javax.swing.JLayeredPane.DEFAULT_LAYER);

        UidLabel.setText("User ID :");
        UidLabel.setBounds(80, 200, 80, 30);
        jLayeredPane1.add(UidLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        PosLabel.setText("Position :");
        PosLabel.setBounds(80, 240, 80, 30);
        jLayeredPane1.add(PosLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        UserName.setBounds(170, 280, 150, 30);
        jLayeredPane1.add(UserName, javax.swing.JLayeredPane.DEFAULT_LAYER);

        UnLabel.setText("User name :");
        UnLabel.setBounds(80, 280, 80, 30);
        jLayeredPane1.add(UnLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        FnLabel.setText("First name :");
        FnLabel.setBounds(80, 320, 80, 30);
        jLayeredPane1.add(FnLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        FirstName.setBounds(170, 320, 150, 30);
        jLayeredPane1.add(FirstName, javax.swing.JLayeredPane.DEFAULT_LAYER);

        LnLabel.setText("Last name :");
        LnLabel.setBounds(80, 360, 80, 30);
        jLayeredPane1.add(LnLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        LastName.setBounds(170, 360, 150, 30);
        jLayeredPane1.add(LastName, javax.swing.JLayeredPane.DEFAULT_LAYER);

        IcLabel.setText("IC no.       :");
        IcLabel.setBounds(80, 400, 80, 30);
        jLayeredPane1.add(IcLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        IcNum.setBounds(170, 400, 150, 30);
        jLayeredPane1.add(IcNum, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Gender.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose", "Male", "Female" }));
        Gender.setBounds(170, 440, 80, 30);
        jLayeredPane1.add(Gender, javax.swing.JLayeredPane.DEFAULT_LAYER);

        GenderLabel.setText("Gender    :");
        GenderLabel.setBounds(80, 440, 80, 30);
        jLayeredPane1.add(GenderLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        RaceLabel.setText("Race        :");
        RaceLabel.setBounds(80, 480, 80, 30);
        jLayeredPane1.add(RaceLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Race.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose", "Chinese", "Malay", "Indian", "Others" }));
        Race.setBounds(170, 480, 80, 30);
        jLayeredPane1.add(Race, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Religion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose", "Buddha", "Islam", "Hindu", "Others" }));
        Religion.setBounds(170, 520, 80, 30);
        jLayeredPane1.add(Religion, javax.swing.JLayeredPane.DEFAULT_LAYER);

        ReligionLabel.setText("Religion    :");
        ReligionLabel.setBounds(80, 520, 80, 30);
        jLayeredPane1.add(ReligionLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Email.setText("devil100001@Evil.com");
        Email.setBounds(570, 200, 150, 30);
        jLayeredPane1.add(Email, javax.swing.JLayeredPane.DEFAULT_LAYER);

        EmailLabel.setText("Email         :");
        EmailLabel.setBounds(490, 200, 70, 30);
        jLayeredPane1.add(EmailLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        ConLabel.setText("Contact    :");
        ConLabel.setBounds(490, 240, 70, 30);
        jLayeredPane1.add(ConLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        Contact.setBounds(570, 240, 150, 30);
        jLayeredPane1.add(Contact, javax.swing.JLayeredPane.DEFAULT_LAYER);
        City.setBounds(570, 280, 150, 30);
        jLayeredPane1.add(City, javax.swing.JLayeredPane.DEFAULT_LAYER);

        CityLabel.setText("City          :");
        CityLabel.setBounds(490, 280, 70, 30);
        jLayeredPane1.add(CityLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        PcLabel.setText("Postcode  :");
        PcLabel.setBounds(490, 320, 70, 30);
        jLayeredPane1.add(PcLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        PostCode.setBounds(570, 320, 150, 30);
        jLayeredPane1.add(PostCode, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jScrollPane1.setViewportView(Address);

        jScrollPane1.setBounds(570, 360, 150, 120);
        jLayeredPane1.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        AddLabel.setText("Address    :");
        AddLabel.setBounds(490, 360, 70, 30);
        jLayeredPane1.add(AddLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        AddEmpButton.setText("Add");
        AddEmpButton.setBounds(580, 560, 80, 30);
        jLayeredPane1.add(AddEmpButton, javax.swing.JLayeredPane.DEFAULT_LAYER);

        CloseEmpButton.setText("Cancel");
        CloseEmpButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CloseEmpButtonActionPerformed(evt);
            }
        });
        CloseEmpButton.setBounds(660, 560, 80, 30);
        jLayeredPane1.add(CloseEmpButton, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Gender1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose", "Planning Manager", "Head of Logistic", "Clerk", "Administrator" }));
        Gender1.setBounds(170, 240, 150, 30);
        jLayeredPane1.add(Gender1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Employee's Personal Details :"));
        jLabel1.setBounds(60, 170, 690, 390);
        jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void CloseEmpButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CloseEmpButtonActionPerformed

        this.setVisible(false);
    }//GEN-LAST:event_CloseEmpButtonActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Employee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Employee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Employee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Employee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Employee().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AddEmpButton;
    private javax.swing.JLabel AddLabel;
    private javax.swing.JEditorPane Address;
    private javax.swing.JTextField City;
    private javax.swing.JLabel CityLabel;
    private javax.swing.JButton CloseEmpButton;
    private javax.swing.JLabel ConLabel;
    private javax.swing.JTextField Contact;
    private javax.swing.JTextField Email;
    private javax.swing.JLabel EmailLabel;
    private javax.swing.JTextField FirstName;
    private javax.swing.JLabel FnLabel;
    private javax.swing.JComboBox Gender;
    private javax.swing.JComboBox Gender1;
    private javax.swing.JLabel GenderLabel;
    private javax.swing.JLabel IcLabel;
    private javax.swing.JTextField IcNum;
    private javax.swing.JLabel IdField;
    private javax.swing.JTextField LastName;
    private javax.swing.JLabel LnLabel;
    private javax.swing.JLabel PcLabel;
    private javax.swing.JLabel PhotoLabel;
    private javax.swing.JLabel PosLabel;
    private javax.swing.JTextField PostCode;
    private javax.swing.JComboBox Race;
    private javax.swing.JLabel RaceLabel;
    private javax.swing.JComboBox Religion;
    private javax.swing.JLabel ReligionLabel;
    private javax.swing.JLabel UidLabel;
    private javax.swing.JLabel UnLabel;
    private javax.swing.JTextField UserName;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
}
